package com.ed100.sass.service.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ed100.sass.model.po.Account;
import com.ed100.sass.service.AccountService;

@Service
public class AccountServiceImpl implements AccountService {

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	
	@Override
	public List<Account> queryAll() {
		
		return sqlSessionTemplate.selectList("account.list");
	}

	@Transactional(propagation=Propagation.REQUIRED)
	public boolean update() {
		Account account = new Account();
		account.setId(2);
		sqlSessionTemplate.update("account.update",account);
		
//		throw new NullPointerException();
		return false;
	}
}
